/*
** my_aff_comb2.c for my_aff_comb2 in /home/gueux_g/piscine/Jour_03
**
** Made by gregory gueux
** Login   <gueux_g@pc-gueux_g>
**
** Started on  Wed Oct  3 11:40:10 2012 gregory gueux
** Last update Thu Oct  4 19:05:03 2012 gregory gueux
*/

void		my_aff(int nb1, int nb2, int nb3, int nb4)
{
  my_putchar(nb1);
  my_putchar(nb2);
  my_putchar(' ');
  my_putchar(nb3);
  my_putchar(nb4);
}

int 		my_condition(int nb1, int nb2, int nb3, int nb4)
{
  if (nb2 == '9' && nb1 == '9')
    return (0);
  else
    my_aff(nb1, nb2, nb3, nb4);
}

void		my_display(int nb1, int nb2, int nb3, int nb4, int d)
{
  while (nb1 <= '9')
    {
      while (nb2 <= '9')
	{
	  while (nb3 <= '9')
	    {
	      while (nb4 <= '9')
		{
		  my_condition(nb1, nb2, nb3, nb4);
		  nb4 = nb4 + 1;
		  d = d + 1;
		  if (d < 8958)
		    write(1, ", ", 2);
		}
	      nb3 = nb3 + 1;
	      nb4 = '1';
	    }
	  nb2 = nb2 + 1;
	  nb3 = '0';
	  nb4 = '1';
	}
      nb1 = nb1 + 1;
      nb2 = '0';
    }
}

int		my_aff_comb2()
{
  int		nb_01;
  int		nb_02;
  int		nb_03;
  int		nb_04;
  int		d;

  nb_01 = '0';
  nb_02 = '0';
  nb_03 = '0';
  nb_04 = '1';
  d = '0';
  my_display(nb_01, nb_02, nb_03, nb_04, d);
  return (0);
}
